# -*- coding: utf-8 -*-
from functools import reduce
from operator import add


def test_reduce():
    ll = [['A', 'B', 'C'], ['A', 'B', 'C'], ]
    ll = [[j * 2 for j in i] for i in ll]

    l = reduce(add, ll, [])
    print(l)


def test_operator():
    """
    海象运算符

    """
    def func(param):
        # code
        result = param + param
        return result

    l0 = list(range(10))
    print(l0)
    l1 = [func(i) for i in l0 if func(i) > 5 and func(i) % 5 != 0]
    print(l1)
    l2 = [j for i in l0 if (j := func(i)) > 5 and j % 5 != 0]
    print(l2)


if __name__ == '__main__':
    # test_reduce()
    test_operator()
